package LuoGu;

import java.util.Scanner;

public class P1055 {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String ip=sc.next();
        int tmp1=1;
        int sum=0;
        for(int i=0;i<ip.length()-2;i++){
            if(ip.charAt(i)=='-'){
                continue;
            }else{
                sum+=tmp1*(int)(ip.charAt(i)-'0');
                tmp1++;
            }
        }
        String rex="[0-9]-[0-9]{3}-[0-9]{5}-[0-9]";
        boolean matches = ip.matches(rex);
        int is=ip.charAt(ip.length()-1)-'0';
        if(matches&&(is==(sum%11))){
            System.out.println("Right");
        }else{
            if(sum%11==10&&ip.charAt(ip.length()-1)=='X'){
                System.out.println("Right");
                System.exit(0);
            }
            char[] charArray = ip.toCharArray();
            if(sum%11==10){
                charArray[charArray.length-1]='X';
            }else {
                charArray[charArray.length - 1] = (char) ((sum % 11) + '0');
            }
            String output=new String(charArray);
            System.out.println(output);
        }
    }
}
